feat: add extensibility points for HttpContent matchers#466
Conversation
There was a problem hiding this comment.
Pull request overview
Adds predicate-based extensibility points for matching HttpContent bodies, updates tests/docs accordingly, and adjusts the public API surface to reflect the new matcher options.
Changes:
- Added predicate overloads for matching string and binary
HttpContentbodies. - Updated/extended
HttpClient/HttpRequestMessagematcher tests and renamed string-related test cases for clarity. - Updated documentation and API expectation snapshots; removed the old
WithBytesContainingsurface.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| Tests/Mockolate.Tests/Web/ItExtensionsTests.IsHttpRequestMessageTests.WhoseContentIsTests.cs | Adds new request-content predicate tests and renames string matcher tests. |
| Tests/Mockolate.Tests/Web/ItExtensionsTests.IsHttpContentTests.WithStringTests.cs | Adds predicate-based WithString tests and removes an unused regex using. |
| Tests/Mockolate.Tests/Web/ItExtensionsTests.IsHttpContentTests.WithBytesTests.cs | Adds predicate-based WithBytes tests. |
| Tests/Mockolate.Tests/Web/ItExtensionsTests.IsHttpContentTests.WithBytesContainingTests.cs | Removes tests for the removed WithBytesContaining API. |
| Tests/Mockolate.Api.Tests/Expected/Mockolate_netstandard2.0.txt | Updates expected API surface for netstandard2.0. |
| Tests/Mockolate.Api.Tests/Expected/Mockolate_net8.0.txt | Updates expected API surface for net8.0. |
| Tests/Mockolate.Api.Tests/Expected/Mockolate_net10.0.txt | Updates expected API surface for net10.0. |
| Source/Mockolate/Web/ItExtensions.HttpContent.cs | Implements predicate-based matchers for string/bytes and removes WithBytesContaining. |
| README.md | Documents new predicate-based matcher overloads and removes WithBytesContaining. |
| Docs/pages/special-types/01-httpclient.md | Mirrors README docs update for new overloads and removed API. |
🚀 Benchmark ResultsDetails
|
|
|
This is addressed in release v1.4.0. |



Adds predicate-based extensibility points for matching
HttpContentbodies, updates tests/docs accordingly, and adjusts the public API surface to reflect the new matcher options.Key Changes:
HttpContentbodies.HttpClient/HttpRequestMessagematcher tests and renamed string-related test cases for clarity.WithBytesContainingsurface.HttpContent#465